package com.platform.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.platform.comm.constants.GlobalConstant;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * Title: CommonDataInfoDto
 * Description: 资源批处理流程附件上传信息
 * Date 2020/4/28
 *
 * @author wxw
 * @version v1.0
 */
@Data
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class CommonDataInfoDto {
    private String id;
    private String fileType;
    private String fileName;
    private String fileUrl;
    private BigDecimal fileLength;
    @JsonFormat(pattern = GlobalConstant.DATE_TIME_PATTERN, shape = JsonFormat.Shape.STRING)
    @DateTimeFormat(pattern = GlobalConstant.DATE_TIME_PATTERN)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime uploadDate;
    private String uploadUser;
    private String uploadDept;
    @JsonIgnore
    private String subType;
}
